﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DTO;//luon luon them 
using BUS;
using System.Data.SqlClient;//luon luon them

namespace QLST
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        
        private void Form1_Load(object sender, EventArgs e)
        {
            
           HoaDonBUS    cls = new HoaDonBUS   ();
           dataGridViewX1.DataSource = cls.Load_HoaDon();
        }

        private void buttonX1_Click(object sender, EventArgs e)
        {
            HoaDonDTO p=new HoaDonDTO ();
            HoaDonBUS  cls = new HoaDonBUS ();
            p.MaHD =t1.Text ;
            p.MaKH = t3.Text;
            p.MaSP = t2.Text;
            p.SoLuong = float.Parse (t4.Text);
            p.TongTien = float.Parse (t5.Text);
            p.NgayMua = date.Value ;
            p.MaNV = t7.Text;
            p.GiaBan = float.Parse(t8.Text);
            bool flag=true ;            
           cls.IsUp_HoaDon(p, flag);

            Form1_Load(sender, e);
        }
    }
}
